﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Tool;
using BrokerBase.Lib.Base;
using BrokerBase.Lib.Product;

namespace BrokerBase.Lib.Policy
{
    public abstract class BasePolicy:IBasePolicy
    {
        private ProductType pType;

        public BasePolicy()
        {
            MaxInsuranceAge = 105;
        }

        public BasePolicy(ProductType pType)
        {
            this.pType = pType;
        }

        public virtual IScheme Owner { get; set; }


        public virtual int InsurancePeriodLength
        {
            get { return PolicyUtil.GetInsurancePeriodLength(this); }
        }

        public virtual int PaymentPeriodLength
        {
            get { return PolicyUtil.GetPaymentPeriodLength(this); }
        }

        public virtual ProductType ProductType 
        { 
            get { return this.pType; }
            set { this.pType = value; }
        }

        public virtual int MaxInsuranceAge { get; set; }

        public virtual double Amount { get; set; }

        public virtual ITimeUnit SelectedTimeUnit { get; set; }

        public virtual double Fee { get; set; }

        public virtual double TotalFee { get; set; }

        public virtual string Description { get; set; }

        public abstract object Clone();

        public virtual bool IsVerify { get; set; }

        public virtual PolicyTarget Target { get { return PolicyTarget.Insurant; } }
    }
}
